#!/bin/bash
#
##创建任意数字及长度的数组，根据客户的需求加入元素
# Copyright 2022 yanyanl

function crateArr() {
  i=0  #数组的下标

  while true; do
    read -p "if you want to create an arr, please input yes/no: " doing
    if [ $doing == no ]; then
    break;
    fi
      read -p "please input 元素: "  element
      arr[$i]=$element
      let i++

    done
    #打印数组
  echo ${arr[*]}

}

crateArr


